﻿using System.Net.WebSockets;
using System.Text;

namespace WebSocketDemo
{
    public class WebSocketClient
    {
        public string Id { get; set; }
        public WebSocket WebSocket { get; set; }
        public string RoomNo { get; set; }

        public async Task SendMessageAsync(string message)
        {
            await WebSocket.SendAsync(
                buffer: Encoding.UTF8.GetBytes(message),
                messageType: WebSocketMessageType.Text,
                endOfMessage: true,
                cancellationToken: CancellationToken.None
                );
        }
    }
}
